package com.br.generateswingview.core;

import java.awt.Component;

import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class GVUtils {
	public static Component getElementByName( JDialog frame, String field ) {
		JPanel panel = (JPanel) frame.getContentPane().getComponents()[0];
		for ( Component c : panel.getComponents() ) {
			if ( c.getName().equals( field ) ) {
				return c;
			}
		}
		return null;
	}
}
